#include <iostream>
#include <string>
#include <unordered_map>
#include <cctype>

int const maxn = 200007;
bool vis[maxn];
std::string s, t;

char exchange(char ch)
{
	if (std::islower(ch)) return std::toupper(ch);
	else return std::tolower(ch);
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::unordered_map<char, int> count;
	std::cin >> s >> t;
	for (auto i : t) count[i]++;
	int c1 = 0, c2 = 0;
	for (int i = 0; i < (int)s.size(); i++)
		if (count[s[i]]) {
			vis[i] = true;
			count[s[i]]--;
			c1++;
		}
	for (int i = 0; i < (int)s.size(); i++) {
		if (vis[i]) continue;
		if (count[exchange(s[i])]) {
			count[exchange(s[i])]--;
			c2++;
		}
	}
	std::cout << c1 << ' ' << c2 << '\n';
}

